<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <ui:composition template="../templates/template_professor.xhtml">
        <ui:define name="content">
            <div id="content">
                <h:form id="faltas">
                    <h3>Faltas</h3>
                    <span class="identText">
                        Selecione uma das disciplinas listadas.
                    </span>
                    <br/><label for="cadastrar">Escolha a disciplina: </label>
                    <h:selectOneMenu id="faltasDisciplina" value="#{cadastroDiscente.turma}" onchange="submit()"
                                     valueChangeListener="#{cadastroDiscente.geraFaltasTurma}">
                        <f:selectItem itemLabel="Selecione a disciplina..." itemValue="null" disabled="true" />
                        <f:selectItems value="#{cadastroDiscente.listaTurmas}" />
                    </h:selectOneMenu>
                    <br/>
                    <fieldset class="ff">
                        <h:dataTable id="notasRegistro" value="#{cadastroDiscente.faltas}" var="faltas"
                                     columnClasses="list-column-nomes" headerClass="list-header" rowClasses="list-row" styleClass="list-background">
                            <h:column>
                                <f:facet name="header">
                                    <h:outputText value="Faltas na disciplina: "/>
                                </f:facet>
                                <h:outputText value="#{faltas}" />
                            </h:column>
                        </h:dataTable>
                    </fieldset>
                    <h:outputText value="Total de faltas: #{cadastroDiscente.num_faltas}"
                                  style="font-weight: bold"/>
                </h:form>
            </div>
        </ui:define>
    </ui:composition>
</html>
